package controllers

import (
	"databaseStudy/models"
	"databaseStudy/models/globalValues"
	beego "github.com/beego/beego/v2/server/web"
)

type BackController struct {
	beego.Controller
}

func (c BackController) Post()  {
	token:=c.GetString("token")
	res:=globalValues.CheckToken(token)
	if !res{
		c.Ctx.ResponseWriter.WriteHeader(400)
	}
	s,err:=models.Backup()
	if err!=nil{
		c.Ctx.ResponseWriter.WriteHeader(400)
	}
	c.Ctx.WriteString(s)
}
